/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.finance.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.finance.entity.ViDeaElectroniccard;
import com.vivo.finance.dao.ViDeaElectroniccardDao;

/**
 * 电子保卡Service
 * @author jyangye
 * @version 2018-01-21
 */
@Service
@Transactional(readOnly = true)
public class ViDeaElectroniccardService extends CrudService<ViDeaElectroniccardDao, ViDeaElectroniccard> {

    @Autowired
    private ViDeaElectroniccardDao viDeaElectroniccardDao;

	public ViDeaElectroniccard get(String id) {
		return super.get(id);
	}
	
	public List<ViDeaElectroniccard> findList(ViDeaElectroniccard viDeaElectroniccard) {
		return super.findList(viDeaElectroniccard);
	}
	
	public Page<ViDeaElectroniccard> findPage(Page<ViDeaElectroniccard> page, ViDeaElectroniccard viDeaElectroniccard) {
		return super.findPage(page, viDeaElectroniccard);
	}

	public ViDeaElectroniccard getLast(ViDeaElectroniccard viDeaElectroniccard) {
	    return viDeaElectroniccardDao.getLastChangeData(viDeaElectroniccard);
    }
	
	@Transactional(readOnly = false)
	public void save(ViDeaElectroniccard viDeaElectroniccard) {
		super.save(viDeaElectroniccard);
	}
	
	@Transactional(readOnly = false)
	public void delete(ViDeaElectroniccard viDeaElectroniccard) {
		super.delete(viDeaElectroniccard);
	}

	@Transactional(readOnly = false)
	public void insertByBatch(List<ViDeaElectroniccard> orderList, String area) {
	    if (area.equals("ah")) {
	        viDeaElectroniccardDao.insertByBatchAh(orderList);
        } else {
	        viDeaElectroniccardDao.insertByBatchJs(orderList);
        }
    }
}